package com.itheima.mylistdemo;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class MyListDemo {
    public static void main(String[] args) {
        List<String>list = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        list.add("ddd");
        Iterator<String> it = list.iterator();
        while (it.hasNext()){
            System.out.println(it.next());
        }

    }
}
